#!/usr/bin/python3
#Filename: backup.py

import os
import time


source = ["/root/workspace", "/root/.vim"]
target_dir = "/root/backup"
target = target_dir + os.sep + time.strftime('%Y_%m_%d_%H_%M_%S')+'.zip'
priviliage = 0b111101101
zip_cmd = "zip -qr {0} {1}".format(target, ' '.join(source))


if os.system(zip_cmd) == 0:
    print('Backup successfuly to:', target)
else:
    print('Backup FAILED')
